<?php

/**
 * Lekarz form base class.
 *
 * @method Lekarz getObject() Returns the current form's model object
 *
 * @package    Rejestracja
 * @subpackage form
 * @author     Michał Sobczak (smichal88@gmail.com)
 */
abstract class BaseLekarzForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idLekarz'      => new sfWidgetFormInputHidden(),
      'imie'          => new sfWidgetFormInputText(),
      'nazwisko'      => new sfWidgetFormInputText(),
      'specjalizacja' => new sfWidgetFormInputText(),
      'telefon'       => new sfWidgetFormInputText(),
      'pager'         => new sfWidgetFormInputText(),
      'email'         => new sfWidgetFormInputText(),
      'zdjecie'       => new sfWidgetFormInputText(),
      'haslo'         => new sfWidgetFormInputText(),
      'opis'          => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'idLekarz'      => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdlekarz()), 'empty_value' => $this->getObject()->getIdlekarz(), 'required' => false)),
      'imie'          => new sfValidatorString(array('max_length' => 60, 'required' => false)),
      'nazwisko'      => new sfValidatorString(array('max_length' => 80)),
      'specjalizacja' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'telefon'       => new sfValidatorString(array('max_length' => 12)),
      'pager'         => new sfValidatorString(array('max_length' => 12, 'required' => false)),
      'email'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'zdjecie'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'haslo'         => new sfValidatorString(array('max_length' => 40)),
      'opis'          => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('lekarz[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Lekarz';
  }


}
